//
//  YJNetworkTool.h
//  YJB
//
//  Created by 中电大维 on 16/5/14.
//  Copyright © 2016年 YJB. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

@interface YJNetworkTool : NSObject
/**
 * POST请求 发送JSON数据
 */
+ (NSURLSessionDataTask *)postWithUrl:(NSString *)url parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;
/** post 发送原始数据*/
+(NSURLSessionDataTask *)postWithUrl:(NSString *)url oringnParameters:(id)oringnParameters success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure;

/**
 *  上传图片
 *
 *  @param url           url
 *  @param parameters    参数
 *  @param bodyWithBlock 上传图片调用
 *  @param progress      上传进度
 *  @param success       成功回调
 *  @param failure       失败回调
 */
+ (void)uploadWithUrl:(NSString *)url
           parameters:(id)parameters
        bodyWithBlock:(void (^)(id<AFMultipartFormData>formData))bodyWithBlock
             progress:(nullable void (^)(NSProgress * _Nonnull uploadProgress))progress
              success:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSDictionary *_Nonnull responseObject))success
              failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *_Nonnull error))failure;

@end
